AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include('shared.lua')

function ENT:Initialize()
	self.BaseClass.Initialize(self)
	lastuse = CurTime()
	self.dt.On = false
end

function ENT:Think()	
	if (ValidEntity(self.dt.Owner)==false) then
		self.Entity:Remove()
	end
	if(self.Entity:IsPowered() == false) then self.dt.On = false self.Entity:SetColor(200,0,0,255) end
	self.Entity:NextThink(CurTime()+0.1)
end

function ENT:Use()
	if(CurTime() < lastuse+1) then return end
	lastuse = CurTime()
	if(self.dt.On == false && self.Entity:IsPowered() == true) then 
		self.dt.On = true 
		self.Entity:SetColor(255,255,255,255)
	else
		self.dt.On = false 
		self.Entity:SetColor(200,0,0,255)
	end
end

function ENT:OnRemove()

end